﻿namespace SocialShare.MVC.Domain.Shared
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public static class DomainObjectUtils
    {
        /// <summary>
        /// Null safe operation.
        /// </summary>
        /// <typeparam name="T">type</typeparam>
        /// <param name="actual">actual value</param>
        /// <param name="safe">a null-safe value</param>
        /// <returns>actual value, if it's not null, or safe value if the actual value is null.</returns>
        public static T NullSafe<T>(T actual, T safe)
            where T : class
        {
            return actual ?? safe;
        }
    }
}
